package top.jle.wx.proxy.config;

import feign.Request;
import feign.Retryer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.TimeUnit;

@Configuration
public class FeignRetryConfig {
    public static final long connectTimeOutMillis = 5000L;//超时时间
    public static final long readTimeOutMillis = 5000L;

    @Bean
    public Request.Options options() {
        return new Request.Options(connectTimeOutMillis, TimeUnit.MILLISECONDS, readTimeOutMillis,TimeUnit.MILLISECONDS,true);
    }
    @Bean
    public Retryer feignRetryer(){
        return new Retryer.Default(100, 3000, 4);
    }
}
